<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2021/3/15
 * Time: 10:55 PM
 */

namespace App\Factory\absfactory;


use App\Factory\BJCheesePizza;
use App\Factory\BJPepperPizza;

class BJFactory implements AbsFactory
{

    public function createPizza($orderType)
    {
        // TODO: Implement createPizza() method.
        echo "~使用的是抽象工厂模式~";
        $pizza = null;
        if($orderType == "cheese") {
            $pizza = new BJCheesePizza();
        } else if ($orderType == "pepper"){
            $pizza = new BJPepperPizza();
        }
        return $pizza;

    }
}